package com.zerui.manager.devciecurfewtimelog.gatewayimpl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.zerui.manager.devciecurfewtimelog.DeviceCurfewtimeLog;
import com.zerui.manager.devciecurfewtimelog.gateway.DeviceCurfewtimeLogGateWay;
import com.zerui.manager.devciecurfewtimelog.mapper.DeviceCurfewtimeLogMapper;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Author wh
 * @create_time 2023-08-23 15:28
 */
@Component
public class DeviceCurfewtimeLogGateWayImpl implements DeviceCurfewtimeLogGateWay {

	@Resource
	private DeviceCurfewtimeLogMapper mapper;

	@Override
	public DeviceCurfewtimeLog getByDeviceId(Long id) {
		LambdaQueryWrapper<DeviceCurfewtimeLog> queryWrapper = Wrappers.lambdaQuery();
		queryWrapper.eq(DeviceCurfewtimeLog::getDeviceId,id);
		return mapper.selectOne(queryWrapper);
	}

	@Override
	public void update(DeviceCurfewtimeLog deviceCurfewtimeLog) {

	}

	@Override
	public void add(DeviceCurfewtimeLog deviceCurfewtimeLog) {
		mapper.insert(deviceCurfewtimeLog);
	}
}
